package com.example.finalwork.service;


import com.example.finalwork.entity.User;
import com.example.finalwork.entity.dao.UserDao;

import java.util.List;


public interface IUserService {
    /**
     * 插入用户
     *
     * @param user
     * @return
     */
    User add(UserDao user);

    /**
     * 根据用户ID获取用户信息
     *
     * @param userId
     * @return
     */
    User get(Integer userId);

    /**
     * 修改用户
     *
     * @param user
     * @return
     */
    User edit(UserDao user);

    /**
     * 删除用户
     *
     * @param userId
     */
    void delete(Integer userId);


    List<User> getUsersInAgeRange(Integer minAge, Integer maxAge);


    User getByName(String userName);

    List<User> getUsersByNickname(String nickname);

    User getByEmailAndPassword(String email, String password);
}
